<template>
  <div class="cell">
	  
    <div @click="getDetail">
		  <h2><span v-show="index!==null">{{index + 1}}.</span>{{data.title}}</h2>
		  <p>{{data.des}}</p>
	</div>
	
    <div class="slot"><slot></slot></div>
    
  </div>
</template>

<script>
  export default {
    name:'hq-cell',
    props:{
      data:{
        type:Object,
        required:true,
        default:function(){
          return {
            title:'xxx',
            des:'xxxxx'
          }
        }
      },
      index:{
        type:Number,
        default:null,
      },
      to:{
        type:String,
        default:''
      },
      url:{
        type:String,
        default:''
      }
    },
    methods:{
      getDetail(){
        console.log('...');
        if(this.url){
          //多页  window.open | window.location.href
          window.open(this.url,'_blank')
        }
        if(this.to){
          this.$router.push(this.to)
        }
      }
    }
  }
</script>

<style scoped>
.cell { color:#494d4d; padding:0.2rem 0; border-bottom:1px dashed #ccc;}
.cell h2{max-height:0.9rem; font-size:0.33rem; overflow:hidden;}
.cell p{max-height:1.8rem; margin-top:0.05rem;overflow:hidden;}
.cell{clear: both;/* margin-bottom:1rem; */}
.slot{float: right;}
</style>
